#【练习】青蛙跳井

class Frog():
    def __init__(self):
        self.memo={}
    def jump(self,n):
        if n in self.memo:
            return self.memo[n]
        if n==1:
            return 1
        if n==2:
            return 2
        res=self.jump(n-1) + self.jump(n-2)
        self.memo[n]=res
        return res

if __name__ == '__main__':
        frog=Frog()
        num=frog.jump(10)
        print(f"青蛙跳上这10个台阶共有 {num} 种跳法")